<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/connopen.asp"-->
<!--#include file="lib/asp-common-lib.asp"-->
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>报关单登记系统</title>
<!--#include file="lib/plugins.asp"-->
<style type="text/css">
	.ui-datepicker table {
		border: 0;
	}
</style>
<script type="text/javascript">
	$(function() {
	});
</script>	
<!--#include file="lib/js-google-analytics.asp"-->
</head>
<%
if not session("sUserName")="admin" then call JumpErrorPage(2)
ul_date=date()
id=SafeRequest(("id"),1)
if 	SafeRequest(("ul"),0)="提交" then
	ul_date=trim(SafeRequest("ul_date",0))
	ul_post=SafeRequest("ul_post",1)
	ul_cont=trim(SafeRequest("ul_cont",0))

	if id="" then
		sql="insert into ul(ul_date,ul_post,ul_cont) values('"&ul_date&"',"&ul_post&",'"&ul_cont&"')"
	else
		sql="update ul set ul_date='"&ul_date&"',ul_post="&ul_post&",ul_cont='"&ul_cont&"' where id="&id
	end if

	set cmd=Server.CreateObject("ADODB.Command")
	cmd.ActiveConnection = conn
	cmd.CommandText = sql
	cmd.Execute
	'cmd.ActiveConnection.Close
	' view_url="updatelog.asp"
	' response.Redirect(view_url)
end if	

if id<>"" then
	sql = "select * from ul where id="&id
	Set rs = Server.CreateObject("ADODB.Recordset")
	rs.Open sql,conn,1,1
	if not rs.eof then
		ul_date=rs("ul_date")
		ul_post=rs("ul_post")
		ul_cont=rs("ul_cont")
	else
		'response.write("未找到数据")
		response.redirect("error.asp?id=1")
	end if
	rs.close
	set rs=nothing
end if
%>

<body>
<!--#include file="lib/header.asp"-->
<!--#include file="lib/nav.asp"-->
<div id="main">
<!--#include file="lib/col1.asp"-->
<!--#include file="lib/col2.asp"-->
	<div id="col3" role="main">
		<div id="col3_content" class="clearfix">
			<form method="post" action="#">
			时间：<input name="ul_date" value="<%=ul_date%>" /><br />
			岗位：<select name="ul_post">
							<option value="0" <%if ul_post=0 then response.write("selected")%>>系统</option>
							<option value="1" <%if ul_post=1 then response.write("selected")%>>同步</option>
						</select><br />
			内容：<textarea cols="80" name="ul_cont"><%=ul_cont%></textarea><br />
			<input type="submit" name="ul" value="提交" />

			</form>
			<%
			Set rs = Server.CreateObject("ADODB.Recordset")
			sql = "SELECT *  FROM ul where ul_post=0 order by ul_date desc,ul_post asc,id desc"
			rs.Open sql,conn,1,1
			%>
			<table>
				<tr>
					<th>id</th>
					<th>date</th>
					<th>post</th>
					<th>cont</th>
				</tr>
			<%
			do while not rs.eof
			%>
				<tr>
					<td><a href="updatelog.asp?id=<%=rs("id")%>"><%=rs("id")%></a></td>
					<td><%=rs("ul_date")%></td>
					<td><%=rs("ul_post")%></td>
					<td><%=rs("ul_cont")%></td>
				</tr>
			<%
				rs.movenext
			loop
			%>
			</table>
			<%
			rs.close
			set rs=nothing
			%>
		</div>
	</div>
</div>
<!--#include file="lib/footer.asp"-->
</body>
</html>
<!--#include file="lib/connclose.asp"-->

